﻿using System.Collections.Generic;
using System.Data;
using PPI.Entities.Inspections;
using VMind.Global;

namespace PPI.Client.Logic.Distribution
{
    public class LResultType
    {
        public static List<EResultType> SelectAllIdName()
        {
            DataTable dt = WebConsumer.Distribution.WDistributionResultTypes.SelectAllIdName().Tables[0];
            List<EResultType> lstResultType = new List<EResultType>();

            foreach (DataRow drTreatment in dt.Rows)
            {
                EResultType resultType = new EResultType();
                
                resultType.Id = ConvertHelper.ToInt32(drTreatment["Vendor_InspVisit_XmissionStructures_ResultTypeId"]);
                resultType.Name = drTreatment["Name"].ToString();

                lstResultType.Add(resultType);
            }

            return lstResultType;
        }
    }
}
